Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

[Release Notes] 20210222_v1 - Refined Main site dark mode style

[Release Notes] 20210222_v1 - Refined Main site dark mode style

學習 Git - 什麼是 HEAD?

學習 Git - 什麼是 HEAD?

JQ總務處|點擊空白處關閉漢堡選單

JQ總務處|點擊空白處關閉漢堡選單






留言討論